
//
//  OrderPayCell.m
//  DaJiang
//
//  Created by sally on 16/10/10.
//  Copyright © 2016年 jiniu. All rights reserved.
//

#import "OrderPayCell.h"

@interface OrderPayCell ()

@property (weak, nonatomic) IBOutlet UIButton *wxSelectBtn;
@property (weak, nonatomic) IBOutlet UIButton *wxBtn;
@property (weak, nonatomic) IBOutlet UIButton *alipaySelectBtn;
@property (weak, nonatomic) IBOutlet UIButton *alipayBtn;

@end

@implementation OrderPayCell

- (void)awakeFromNib {
  [self initControl];
}

- (void)initControl {
  self.wxSelectBtn.selected = YES;
  self.wxBtn.selected = YES;
}

//微信支付
- (IBAction)actionOnSelectWx:(id)sender {
  self.wxSelectBtn.selected = !self.wxSelectBtn.isSelected;
  self.wxBtn.selected = self.wxSelectBtn.selected;
  self.alipaySelectBtn.selected = !self.wxSelectBtn.selected;
  self.alipayBtn.selected = self.alipaySelectBtn.selected;
  if (self.delegate && [self.delegate respondsToSelector:@selector(selectPayMethod:)]) {
    [self.delegate selectPayMethod:OrderPayMethod_WX];
  }
}

//支付宝支付
- (IBAction)actionOnSelectAlipay:(id)sender {
  self.alipaySelectBtn.selected = !self.alipaySelectBtn.isSelected;
  self.alipayBtn.selected = self.alipaySelectBtn.selected;
  self.wxSelectBtn.selected = !self.alipaySelectBtn.selected;
  self.wxBtn.selected = self.wxSelectBtn.selected;
  if (self.delegate && [self.delegate respondsToSelector:@selector(selectPayMethod:)]) {
    [self.delegate selectPayMethod:OrderPayMethod_Alipay];
  }
}

@end
